<?php
	include "C:/xampp/htdocs/jrckeditor/db_edit/dbinfo.inc.php";
	$did = $_GET['did'];
	
	mysql_connect($hostname, $username, $password, FALSE);
	@mysql_select_db($database) or die("Unable to select database");
	
	$result = mysql_query('SELECT * FROM ' . $edit_table . ' WHERE did = ' .$did. ' ORDER BY id ASC;');
	if (!$result) {
		die('Invalid query: ' . mysql_error());
	}
	$text = "";
	while($row = mysql_fetch_array($result)) {
		$loc = $row['location'];
		$char = $row['char'];
		$a = substr($text, 0, $loc);
		$b = substr($text, $loc, strlen($text));
		$text = $a . $char . $b;
	}
	echo $text;
	
	mysql_close();
?>